import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
import Layout from '@/layout/index.vue';
const routes: Array<RouteRecordRaw> = [
  {
    path: '/login',
    component: () => import('../views/login/Login.vue'),
  },
  {
    path: '/register',
    component: () => import('../views/register/Register.vue'),
  },
  {
    path: '/',
    redirect: '/login',
  },
  {
    path: '/homepage',
    component: Layout,
    meta: {
      title: '首页',
    },
    children: [
      {
        path: '/home',
        component: () => import('../views/homepage/Homepage.vue'),
        name: 'home',
        meta: {
          title: '一周鱼缸鱼数统计',
        }
      },
      {
        path: '/personal',
        component: () => import('../views/personal/PersonalSeltting.vue'),
        name: 'personal',
        meta: {
          title: '个人设置',
        },
      },
      {
        path: '/management',
        component: () => import('../views/management/UserManagement.vue'),
        name: 'management',
        meta: {
          title: '用户管理',
        },
      },
    ]
  },
  {
    path: '/platform',
    component: () => import('../views/platform/Data.vue'),
    name: 'platform',
    meta: {
      title: '水族箱可视化平台',
    },
  },
  {
    path: '/analyse',
    component: Layout,
    meta: {
      title: '影响因素分析',
    },
    children: [
      {
        path: '/PH',
        component: () => import('../views/analyse/PH.vue'),
        name: 'PH',
        meta: {
          title: 'pH分析',
        }
      },
      {
        path: '/temperatuer',
        component: () => import('../views/analyse/Temperature.vue'),
        name: 'temperatuer',
        meta: {
          title: '温度分析',
        }
      },
      {
        path: '/electrical',
        component: () => import('../views/analyse/Electrical.vue'),
        name: 'electrical',
        meta: {
          title: '电导率分析',
        }
      },
      {
        path: '/muddy',
        component: () => import('../views/analyse/Muddy.vue'),
        name: 'muddy',
        meta: {
          title: '浑浊度分析',
        }
      }
    ]
  },
  {
    path: '/Informations',
    component: Layout,
    meta: {
      title: '信息录入',
    },
    children: [
      {
        path: '/fishmgs',
        component: () => import('../views/informations/FishMgs.vue'),
        name: 'fishmgs',
        meta: {
          title: '鱼类信息',
        }
      },
      {
        path: '/tankmgs',
        component: () => import('../views/informations/TankMgs.vue'),
        name: 'tankmgs',
        meta: {
          title: '鱼缸信息',
        }
      }
    ]
  },
  {
    path: '/administrate',
    component: Layout,
    meta: {
      title: '信息录入',
    },
    children: [
      {
        path: '/control',
        component: () => import('../views/administrate/Control.vue'),
        name: 'control',
        meta: {
          title: '鱼缸信息',
        }
      },
      {
        path: '/monitor',
        component: () => import('../views/administrate/Monitor.vue'),
        name: 'monitor',
        meta: {
          title: '鱼类信息',
        }
      }
    ]
  },
  {
    path: '/specialist',
    component: Layout,
    meta: {
      title: '专家系统',
    },
    children: [
      {
        path: '/diseaseBooks',
        component: () => import('@/views/specialist/public/DiseaseBooks.vue'),
        name: 'diseaseBooks',
        meta: {
          title: '鱼病百科'
        }
      },
      {
        path: '/fishBooks',
        component: () => import('@/views/specialist/public/FishBooks.vue'),
        name: 'fishBooks',
        meta: {
          title: '鱼类百科'
        }
      },
      {
        path: '/diagnosis',
        component: () => import('@/views/specialist/public/Diagnosis.vue'),
        name: 'diagnosis',
        meta: {
          title: '疾病自诊',
        }
      },
      {
        path: '/consultation',
        component: () => import('@/views/specialist/common/Consultation.vue'),
        name: 'consultation',
        meta: {
          title: '专家问诊',
        }
      },
      {
        path: '/application',
        component: () => import('@/views/specialist/common/Application.vue'),
        name: 'application',
        meta: {
          title: '成为专家',
        }
      },
      {
        path: '/treatment',
        component: () => import('@/views/specialist/expert/Treatment.vue'),
        name: 'treatment',
        meta: {
          title: '给鱼看病',
        }
      },
      {
        path: '/information',
        component: () => import('@/views/specialist/expert/Informations.vue'),
        name: 'information',
        meta: {
          title: '专家信息',
        }
      },
      {
        path: '/inspect',
        component: () => import('@/views/specialist/administrator/Inspect.vue'),
        name: 'inspect',
        meta: {
          title: '专家审核',
        }
      },
    ]
  }
]
const router = createRouter({
  history: createWebHistory(),
  routes
})
export default router